package com.zhangzhan.controller;

import com.zhangzhan.domain.commcon.ResponseResult;
import com.zhangzhan.service.UploadService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * @author 张一恒
 * @version 1.0
 * @description: 文件上传接口
 * @date 2022/12/3 20:40
 */
@RestController
public class UploadController {

    @Autowired
    private UploadService uploadService;

    /**
     * @description 上传文件
     * @param img
     * @return com.zhangzhan.domain.commcon.ResponseResult
     * @author 31115
     * @date 2022/12/3 21:31
     */
    @PostMapping("/upload")
    public ResponseResult upload(MultipartFile img){
        return uploadService.upload(img);
    }

}
